Use stable creation times when reading waypoitns.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 8 Jan 2004 04:15:04 +0000 (04:15 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 8 Jan 2004 04:15:04 +0000 (04:15 +0000)
gpsbabel/gpsdrive.c
gpsbabel/gpsutil.c

index 2a785e1db0a4c4fb75e38f084bca803e8e3ca327..72b2bd5751505f0a60b6fa709644e689b4ab3125 100644 (file)
@@ -78,6 +78,11 @@ data_read(void)
        waypoint *wpt_tmp;
        int linecount = 0;
        mkshort_rd_handle = mkshort_new_handle();
+       /*
+        * Make sure that all waypoints in single read have same 
+        * timestamp.
+        */
+       time_t now = time(NULL);
 
        do {
                linecount++;
@@ -122,7 +127,7 @@ data_read(void)
                        s = csv_lineparse(NULL, " ", "", linecount);
                }
            
-               wpt_tmp->creation_time = time(NULL);
+               wpt_tmp->creation_time = now;
                
                /* We'll make up our own shortname. */
                if (wpt_tmp->description) {
index 41761c1a43806ec37968e983a2a416dfcc71025e..325a48989254833901de1022290a4ac04cf861f5 100644 (file)
@@ -56,6 +56,12 @@ data_read(void)
        char alttype;
        char icon[3] = {0};
        waypoint *wpt_tmp;
+       /*
+        * Make sure that all waypoints in single read have same 
+        * timestamp.
+        */
+       time_t now = time(NULL);
+
 
        for(;fgets(ibuf, sizeof(ibuf), file_in);) {
        /*  A sharp in column zero or an blank line is a comment */
@@ -73,7 +79,7 @@ data_read(void)
                wpt_tmp->altitude = alt;
                wpt_tmp->shortname = xstrdup(name);
                wpt_tmp->description = xstrdup(desc);
-               wpt_tmp->creation_time = time(NULL);
+               wpt_tmp->creation_time = now;
 
                if (latdir == 'S') lat = -lat;
                if (londir == 'W') lon = -lon;